package test07;

/**
 * 审核结果类
 */
public class CheckResult {
    private boolean passed;
    private RiskLevel riskLevel;
    private String message;
    private double confidence;
    private String action; // "PASS", "BLOCK", "REVIEW", "WATERMARK"

    public CheckResult(boolean passed, RiskLevel riskLevel, String message, double confidence, String action) {
        this.passed = passed;
        this.riskLevel = riskLevel;
        this.message = message;
        this.confidence = confidence;
        this.action = action;
    }

    public boolean shouldStopChain() {
        // 高风险或已拦截时停止链传递
        return riskLevel == RiskLevel.HIGH || riskLevel == RiskLevel.BLOCKED;
    }

    @Override
    public String toString() {
        return String.format("审核结果: %s, 风险等级: %s, 操作: %s, 置信度: %.2f",
                passed ? "通过" : "不通过", riskLevel, action, confidence);
    }

    // Getters
    public boolean isPassed() { return passed; }
    public RiskLevel getRiskLevel() { return riskLevel; }
    public String getMessage() { return message; }
    public double getConfidence() { return confidence; }
    public String getAction() { return action; }
}
